#!/bin/sh

# checksum tests to verify that rtp_analyze routines work correctly

BASEDIR="`dirname "${0}"`/.."
. "${BASEDIR}/functions"

SNAMES="sess6 c1 weird dups lost srtp1 alice_to_bob alice_to_bob_out G723_1 \
 DLT_NULL a2b_nosync sipit31"

RTPA_SUBDR="rtp_analyze"

for sname in ${SNAMES}
do
  wfile="rtp_analyze_${sname}.wav"
  if [ -e ${RTPA_SUBDR}/${sname}.args ]
  then
    EAUD_ARGS=`cat ${RTPA_SUBDR}/${sname}.args`
  else
    EAUD_ARGS="${RTPA_SUBDR}/${sname}"
  fi
  ${EXTRACTAUDIO} -s ${EAUD_ARGS} "${wfile}" > rtp_analyze_${sname}.tout 2>rtp_analyze_${sname}.tlog
  report "extracting/analyzing for the ${sname}"
  ${DIFF} ${RTPA_SUBDR}/${sname}.output rtp_analyze_${sname}.tout
  report "checking stats for the ${sname}"
  sha256_verify "${wfile}" ${RTPA_SUBDR}/rtp_analyze1.checksums
done
